package servlet;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@WebServlet("/checkName.do")
public class MyServlet extends HttpServlet {

	@Override
	public void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		PrintWriter pw =  resp.getWriter();
		String username = req.getParameter("username");
		
		if("admin".equals(username)) {
			pw.println("1");
		}else {
			pw.println("0");
		}
		pw.close();
		
	}

}
